#include "Fenetres.h"

//(*InternalHeaders(Menu)
#include <wx/font.h>
#include <wx/intl.h>
#include <wx/string.h>
//*)

//(*IdInit(Menu)
const long Menu::ID_STATICTEXT1 = wxNewId();
const long Menu::ID_BUTTON1 = wxNewId();
const long Menu::ID_BUTTON2 = wxNewId();
const long Menu::ID_BUTTON3 = wxNewId();
const long Menu::ID_BUTTON4 = wxNewId();
const long Menu::ID_GRID1 = wxNewId();
const long Menu::ID_PANEL1 = wxNewId();
//*)

BEGIN_EVENT_TABLE(Menu,wxFrame)
	//(*EventTable(Menu)
	//*)
END_EVENT_TABLE()

Menu::Menu(wxWindow* parent,wxWindowID id)
{
	//(*Initialize(Menu)
	Create(parent, id, _("Base de Donnees des etudiants"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("id"));
	SetClientSize(wxSize(744,450));

	Panel1 = new wxPanel(this, ID_PANEL1, wxPoint(136,152), wxSize(608,450), wxTAB_TRAVERSAL, _T("ID_PANEL1"));

	StaticText1 = new wxStaticText(Panel1, ID_STATICTEXT1, _("Base de donnees des etudiants"), wxPoint(72,32), wxSize(128,48), 0, _T("ID_STATICTEXT1"));
	wxFont StaticText1Font(14,wxSWISS,wxFONTSTYLE_ITALIC,wxNORMAL,false,wxEmptyString,wxFONTENCODING_DEFAULT);
	StaticText1->SetFont(StaticText1Font);
	Button1 = new wxButton(Panel1, ID_BUTTON1, _("Ajouter un etudiant"), wxPoint(16,304), wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON1"));
	Button2 = new wxButton(Panel1, ID_BUTTON2, _("Consulter/modifier les infos d\'un etudiant"), wxPoint(152,304), wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON2"));
	Button3 = new wxButton(Panel1, ID_BUTTON3, _("Voir la liste de tous les etudiants"), wxPoint(56,344), wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON3"));
	Button4 = new wxButton(Panel1, ID_BUTTON4, _("Quitter"), wxPoint(264,368), wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON4"));
	Grid1 = new wxGrid(Panel1, ID_GRID1, wxPoint(24,80), wxSize(440,192), 0, _T("ID_GRID1"));
	Grid1->CreateGrid(200,4);
	Grid1->EnableEditing(false);
	Grid1->SetColLabelSize(0);
	Grid1->SetRowLabelSize(0);

	Connect(ID_BUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&Menu::OnButton1Click);
	Connect(ID_BUTTON2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&Menu::OnButton2Click);
	Connect(ID_BUTTON4,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&Menu::OnButton4Click);
	//*)
}

Menu::~Menu()
{
	//(*Destroy(Menu)
	//*)
}


void Menu::OnButton1Click(wxCommandEvent& event)
{
    extern AddEtu* Add1;
    this->Show(false);
    Add1->Show(true);
}

void Menu::OnButton4Click(wxCommandEvent& event)
{
    this->Destroy();
}

void Menu::OnButton2Click(wxCommandEvent& event)
{
    extern ModifEtu* Modif;
    Modif->Show();
    this->Show(false);
}
